package com.nmc.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * Created by pinky on 2017/2/13.
 */
@Controller
public class GetKeyController {



    @RequestMapping("/getKey")
    @ResponseBody
    public void getKey(String key) {
        if(key.equals("Return"))
            System.out.println("");
        else if(key.equals("Up"))
            System.out.print("↑");
        else if(key.equals("Down"))
            System.out.print("↓");
        else if(key.equals("Left"))
            System.out.print("←");
        else if(key.equals("Right"))
            System.out.print("→");
        else if(key.equals("Space"))
            System.out.print(" ");
        else if(key.equals("Back"))
            System.out.print("*back*");
        else if(key.equals("OemOpenBrackets"))
            System.out.print("[");
        else if(key.equals("Oem6"))
            System.out.print("]");
        else if(key.equals("Oem1"))
            System.out.print(";");
        else if(key.equals("Oem7"))
            System.out.print("'");
        else if(key.equals("Oemcomma"))
            System.out.print(",");
        else if(key.equals("OemPeriod"))
            System.out.print(".");
        else if(key.equals("OemQuestion"))
            System.out.print("/");
        else if(key.equals("Oem5"))
            System.out.print("\\");
        else if(key.equals("SOemtilde"))
            System.out.print("`");
        else if(key.equals("None"))
            System.out.print("Fn");
        else if(key.equals("OemMinus"))
            System.out.print("-");
        else if(key.equals("Oemplus"))
            System.out.print("=");
        else if(key.equals("D1"))
            System.out.print("1");
        else if(key.equals("D2"))
            System.out.print("2");
        else if(key.equals("D3"))
            System.out.print("3");
        else if(key.equals("D4"))
            System.out.print("4");
        else if(key.equals("D5"))
            System.out.print("5");
        else if(key.equals("D6"))
            System.out.print("6");
        else if(key.equals("D7"))
            System.out.print("7");
        else if(key.equals("D8"))
            System.out.print("8");
        else if(key.equals("D9"))
            System.out.print("9");
        else if(key.equals("D0"))
            System.out.print("0");
        else
            System.out.print(key);
    }

}
